package com.cu.jiekong.filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author jintian
 * @date 16:26
 */
@Configuration
public class FilterRegistration {

    @Bean
    public FilterRegistrationBean requestFilter() {
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new RequestFilter());
        registrationBean.addUrlPatterns("/*");
        registrationBean.setName("requestFilter");
        registrationBean.setOrder(1);

        return registrationBean;
    }
}
